UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FLnhemgAb4jmuFCxhVMzxs2aTdkgeIxPV2DgSNf1CuA=' 
WHERE 
  key_id = '5529f6a51140d6b890a8ab25e565a0eb47e6d5ae063199a86ff92fb27e43b68f' 
  AND (
    token = 'FLnhemgAb4jmuFCxhVMzxs2aTdkgeIxPV2DgSNf1CuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024