UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5G2m8CjnX26p9gTdcVl3L0t1A9ukuc9eydWbh8nHAi4='
WHERE
key_id = '2484ded0176404d0a5899e40e7a324b4cd19f7f8531b0ee36fbd79a2df0b013f'
AND (
token = '5G2m8CjnX26p9gTdcVl3L0t1A9ukuc9eydWbh8nHAi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)