UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4V60QukM+G+F8DWuaIWmPn/XFIUUdakIDbWkjvuspGQ=' 
WHERE 
  key_id = '23b66e971084fec6f78924174ef0c970e839e4a288db1d1c52240604d5c5bbdb' 
  AND (
    token = '4V60QukM+G+F8DWuaIWmPn/XFIUUdakIDbWkjvuspGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047