UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZG/wJ+xMXpBQhdTXtBVnHPEPSB+Gj69c73wYvZmg18='
WHERE
key_id = 'a44dfbd8591bb5d0a3799ad7dabb80b4fbc19405533cb1a11a9954813d599b95'
AND (
token = 'kZG/wJ+xMXpBQhdTXtBVnHPEPSB+Gj69c73wYvZmg18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)