UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nOtgVUL5IJiWCW4R9FUOz1mG/DY4l2A0/puruu/FXxI=' 
WHERE 
  key_id = '589fb209da0ec628036a4c2467a49001833737bd1961acb37a53ec90d3f26a26' 
  AND (
    token = 'nOtgVUL5IJiWCW4R9FUOz1mG/DY4l2A0/puruu/FXxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029