UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HiHsjWVJ+UxI4rsSedU8rx5QB6cbb9XlqE6D2mTGWJg='
WHERE
key_id = 'cc14c09e8a8670f2bb2a37a41a026d48bca3447b08d29cb79065ab1fbff5136a'
AND (
token = 'HiHsjWVJ+UxI4rsSedU8rx5QB6cbb9XlqE6D2mTGWJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)