UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BhWXG/kfG9PFQKqtGp+ygybyEI3KvvBxePEXMXHAn28='
WHERE
key_id = 'ed8d458c71a1d1e94fa8195a939be83da281ffcff8e02c40065804e86ea2367e'
AND (
token = 'BhWXG/kfG9PFQKqtGp+ygybyEI3KvvBxePEXMXHAn28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)