UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '04sJCrAT4N6y+Pc5VLBILTxy9+14Tpwaq3fbu4sEAMc='
WHERE
key_id = '41ac76b8984639f19fb30f6d082ec3fc8f53af467c8a4050fd3225d821ea2a1e'
AND (
token = '04sJCrAT4N6y+Pc5VLBILTxy9+14Tpwaq3fbu4sEAMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)