UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1zMgIwBggcuEis1MjEyO4b4f2ffHXYc3ulkL42lh7JQ=' 
WHERE 
  key_id = 'e9af1c5c26c4dfc8c59035fa3d87b0db22408b689ab070d912f3b942922ed902' 
  AND (
    token = '1zMgIwBggcuEis1MjEyO4b4f2ffHXYc3ulkL42lh7JQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024