UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UUmasXQv4IpgjkVFlXTuq/MbATwYCElfcx3YsJea9uU=' 
WHERE 
  key_id = 'ac25741dd6de65f1bb8ef75764c4386459de5e2b6ad6d73e4bfbc6deeaef0bd3' 
  AND (
    token = 'UUmasXQv4IpgjkVFlXTuq/MbATwYCElfcx3YsJea9uU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025