UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jWICw7d+HaWA0e6xiXUvBE4NMZ3UanWE89XX4wEjT/s=' 
WHERE 
  key_id = '809a680014c65fe304c8eb425061d4c038db5b3474fd0fe4b5d68b67cf22ae50' 
  AND (
    token = 'jWICw7d+HaWA0e6xiXUvBE4NMZ3UanWE89XX4wEjT/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00093