UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EZC9XhNm/ZyAbBhGd1Nmz6tIHZd7AhiBB75/O6NIC6s=' 
WHERE 
  key_id = '2ee1e03784b937e95ecca5ba53d2cf1d23c973a082cb3c0eda5fd49b239c257f' 
  AND (
    token = 'EZC9XhNm/ZyAbBhGd1Nmz6tIHZd7AhiBB75/O6NIC6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028