UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FYMU386F7Z3CMCRqlxaNF/X4oTkxVSHDS1/wiY95TjU=' 
WHERE 
  key_id = '41dfb9e40abb785b8ad0de59bbad33f344b803b647c66fb6e141517d8ad8c3e9' 
  AND (
    token = 'FYMU386F7Z3CMCRqlxaNF/X4oTkxVSHDS1/wiY95TjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036