UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oMTocQZ0Cuj0kI/Zn37CZ0IaMC6jGIU/Lq5ZAXy6JZ0='
WHERE
key_id = '82b5e5e80d74142fda40e4827892ac80e342f56bec89913bb9e8ca5e65aa1def'
AND (
token = 'oMTocQZ0Cuj0kI/Zn37CZ0IaMC6jGIU/Lq5ZAXy6JZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)