UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NNdL3AEt/koWmc0FQchlpFBniQ1LdHOAQXgp0QyCtFM='
WHERE
key_id = 'b9e3814a5c843b834dfdd474708a432ef9e9b445cc40fe2cee41065c71910dd3'
AND (
token = 'NNdL3AEt/koWmc0FQchlpFBniQ1LdHOAQXgp0QyCtFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)