UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DkC+/sG1fOJfrd6G8MGJjynL48t5jfOEcFg4WFq8h3o=' 
WHERE 
  key_id = '69ddb439b8061e8dd5a096a99c8d02d529400ddad9fd1976ac13da42a140c46e' 
  AND (
    token = 'DkC+/sG1fOJfrd6G8MGJjynL48t5jfOEcFg4WFq8h3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031