UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NilXj5s7x/emzSmDuusciLDS7TH1eBJwc9EHOHYe+tk='
WHERE
key_id = '637847895589dac4cf1b1cd24968a71a24bbf489ec8f69313de717c68b603afb'
AND (
token = 'NilXj5s7x/emzSmDuusciLDS7TH1eBJwc9EHOHYe+tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)