UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Sw4gROGI8zblTELu1ueIkN1/AcsesUja1Wu6jgq+1E=' 
WHERE 
  key_id = 'cd71e53d629918f183a0f05c9cf6a470e854ec7484c7cc06168d30cd6d06c1d8' 
  AND (
    token = '4Sw4gROGI8zblTELu1ueIkN1/AcsesUja1Wu6jgq+1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022