UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v/w5NJscP/TSkesvc6NRXQFdKA7Qfm/wyQH3GxXwKXY=' 
WHERE 
  key_id = 'e7d32a7b32407f4c5cced0091803929e6aa268d6ae488aef2d7bfee102a34eb6' 
  AND (
    token = 'v/w5NJscP/TSkesvc6NRXQFdKA7Qfm/wyQH3GxXwKXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027