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

Query time 0.00020