UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RjeXAnfUTyRGS704usRUadJ+mDJsXtaAJBKzJXjrDL0=' 
WHERE 
  key_id = 'edcb891c45c4ece55b94c63f2cdc2e3d9e72344cb1aad6f369d30265b0bcb412' 
  AND (
    token = 'RjeXAnfUTyRGS704usRUadJ+mDJsXtaAJBKzJXjrDL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020