UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gub/nV5gwlf5x6XYkxH8zAYOfNLGJhtJt4MaKoDI1Ns='
WHERE
key_id = 'e4e65a29b343c759a3f05af40790721214fae315925845aae6722034c49f6914'
AND (
token = 'Gub/nV5gwlf5x6XYkxH8zAYOfNLGJhtJt4MaKoDI1Ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)