UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VdpeAP8XEDuJUj28XTZfw/3r4sDGew8llWgzlu8mLhM='
WHERE
key_id = '6412f57392fbdb0683ce6c05e1f2559279880632a1721b453f833ae2fecd6405'
AND (
token = 'VdpeAP8XEDuJUj28XTZfw/3r4sDGew8llWgzlu8mLhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)