UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8jYIDwrgLKrRunALfYcRhiF+WhoomTbeivs+w4GDWP0='
WHERE
key_id = 'b1a6de5d5a143aa01c7b52cecc03a98b30105ee71ca47312c136e9e77351818b'
AND (
token = '8jYIDwrgLKrRunALfYcRhiF+WhoomTbeivs+w4GDWP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)