UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vFn7FoJqB09YsBLoUyjYDewdFIkNyjgq7bKuuZRjgfI=' 
WHERE 
  key_id = 'fed65d1877b5d7d14896f0ca6690ce0c6b0fe221311f4c225772f2641046a2da' 
  AND (
    token = 'vFn7FoJqB09YsBLoUyjYDewdFIkNyjgq7bKuuZRjgfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044