UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UEZIdYbdV7MgpsWovw2BjaihsoqrWUcWmk+mFDLldE4='
WHERE
key_id = '5e6b91b292b06bcf4ce194a1caf1f5b22a4dab4ea3c044006eba86cdf1c7ba22'
AND (
token = 'UEZIdYbdV7MgpsWovw2BjaihsoqrWUcWmk+mFDLldE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)