UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4dnaW+fUjfrY4noqHOe4frmiabg3aQ/NJ11n6u6SwK4='
WHERE
key_id = '289a6dabf74ab0b7070e7793ab2aba863b0d3ac31d2d29bbdfaf780dbbec4bd8'
AND (
token = '4dnaW+fUjfrY4noqHOe4frmiabg3aQ/NJ11n6u6SwK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)