UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2J7+45x/EikNUMYsrZ7S5R1HtUI1HU6LHHlx1DVGjHk='
WHERE
key_id = '1b1a271705e6fa6bccaef7d5e638e919793654edac8b6effc3bb112ddcaabc10'
AND (
token = '2J7+45x/EikNUMYsrZ7S5R1HtUI1HU6LHHlx1DVGjHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)