UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A3h8Yxrr3/L7CK7RDC28O1sm8wutH2dLJjzNNWWwE5k=' 
WHERE 
  key_id = '00e7812916ec5bb76441d368b597649ac7c1b6c78d6fc46f3e3540967baca347' 
  AND (
    token = 'A3h8Yxrr3/L7CK7RDC28O1sm8wutH2dLJjzNNWWwE5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045