UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B4VrRHErVds135lCdDmyfUiE2xCGAUf96hoZnR+/DJ4='
WHERE
key_id = 'fa6dabf9298880a6ac66bbe44aae96cb416e2d60e87003f69a47c26ea16ba6d2'
AND (
token = 'B4VrRHErVds135lCdDmyfUiE2xCGAUf96hoZnR+/DJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)