UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a/tOEVWWREEKOKxraNFAgfkcFGwb8WBIQnaYxiUbB2s=' 
WHERE 
  key_id = 'd10be93ef533b4fdefc12d4d3c20ef81682ffa2a9766f17a346a8b1a1c4c2a0c' 
  AND (
    token = 'a/tOEVWWREEKOKxraNFAgfkcFGwb8WBIQnaYxiUbB2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032