UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IPe3CAiUa+9727DsbEqCHJiXOgnRd/mLX03kkC6CQeE='
WHERE
key_id = 'b8df4ac313e39f25bea89dec351c1a0fb59a78c69c4d748d72aa7bbb3c2687a9'
AND (
token = 'IPe3CAiUa+9727DsbEqCHJiXOgnRd/mLX03kkC6CQeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)