UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8bL/dMdvJm/dy69qiv1wGQ6b+iXorfONbl3C6V+xrI='
WHERE
key_id = '228c352a676c45aff179cb50df70cdc0d70b2c6c1b0191dcb2b6f56478485be8'
AND (
token = 'w8bL/dMdvJm/dy69qiv1wGQ6b+iXorfONbl3C6V+xrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)