UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14KsBNZfwtSCXDun9vwe/uCg67hwca2vud9cLElBb1g='
WHERE
key_id = '824e62373ffc2ce9dc940a18a9731e2c0666ce0d02313a86dec7b6cb4b5d7aef'
AND (
token = '14KsBNZfwtSCXDun9vwe/uCg67hwca2vud9cLElBb1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)