UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'URNMZTZp/a2D4du5FRnvMmUdlGkPm52nxk55LFzhGQk=' 
WHERE 
  key_id = 'f822fd8cfb1070d40b1a048d692771c0fa442acd659c66f44008c3f62e46e33a' 
  AND (
    token = 'URNMZTZp/a2D4du5FRnvMmUdlGkPm52nxk55LFzhGQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034