UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jk3q8brmQhkBW/l+eadhNBN63WYG306HmzEMHuxnvuI='
WHERE
key_id = '9bd565bceab319916e995ffca95858e731d34a289f3fe96e4eeda8350460c6df'
AND (
token = 'Jk3q8brmQhkBW/l+eadhNBN63WYG306HmzEMHuxnvuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)