UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GjlWxb9fszrCZrnQND7TjaySeekmh3ym5ZOqtElK92g=' 
WHERE 
  key_id = 'dc66706c367aac71c3781f8375918e57a8022c31c07e8a76aeab4d9790568d55' 
  AND (
    token = 'GjlWxb9fszrCZrnQND7TjaySeekmh3ym5ZOqtElK92g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034