UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/KauE6ryhPTdT6ApztaNr/E2cmtWkfov6u72mH//J4='
WHERE
key_id = 'cdad1f96705bda740a0c325bd1d6a9c93a816e0b7f2723e797ca131a193c7d21'
AND (
token = 'r/KauE6ryhPTdT6ApztaNr/E2cmtWkfov6u72mH//J4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)