UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zXKU8X/DSYsQ1lP/GbcPHuNc2lL8wlj8CbUFs5R6Wcs='
WHERE
key_id = '57ac50efb6b80c25b67ddf19a8faa3414c9af845529e5d0e6d7062ecacffa945'
AND (
token = 'zXKU8X/DSYsQ1lP/GbcPHuNc2lL8wlj8CbUFs5R6Wcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)