UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WkXcOkXXTS/VgYZWb1GtHIMH+m0R1BW+gYdZrpQ88Ho='
WHERE
key_id = '94a8c7d467dab1bc1e8b26ffbac51b274ae89dc58cf42be50006e8cdf397bb9d'
AND (
token = 'WkXcOkXXTS/VgYZWb1GtHIMH+m0R1BW+gYdZrpQ88Ho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)