UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RGVbKGSGxuI/gSN0Dl+a1xeFxYxflZjkshl7pOWDTio=' 
WHERE 
  key_id = '0ad0dd6bdfced5d30472a1956679fa7f076b8d17879936859e15612510081d28' 
  AND (
    token = 'RGVbKGSGxuI/gSN0Dl+a1xeFxYxflZjkshl7pOWDTio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022