UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eZetitirHVaN1hNEE0jv/SbZukw3nlIdsOZrfnS3SxM=' 
WHERE 
  key_id = 'd933a9045f111bf80260e72c82ce77e3456c8448e5d4d7c7fca764b6b4c1864d' 
  AND (
    token = 'eZetitirHVaN1hNEE0jv/SbZukw3nlIdsOZrfnS3SxM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030