UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7jo227OohLcdRHGSSoL8O1TulAXNmFFmXJDWBavj4J8=' 
WHERE 
  key_id = '72d1be88472515d7463c1b69fcd74f0348424f7a8febe775be19c9b1ce2c965b' 
  AND (
    token = '7jo227OohLcdRHGSSoL8O1TulAXNmFFmXJDWBavj4J8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024