UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zBEdqPzpOuvzbruMldHGP6AdNVqe6+qyHwMHDWjydHg='
WHERE
key_id = 'bda2577332ed9c3ae76319e29a1ef0a65344be478dab4338ff6f8efddad190d3'
AND (
token = 'zBEdqPzpOuvzbruMldHGP6AdNVqe6+qyHwMHDWjydHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)