UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1tuRcpaJ1EYKkDR0UEVlLw8rnuDj8ckiACOunvjJ9s='
WHERE
key_id = '44dcff31464c597fa9ff6b49bd7b016b8c97023e9a114d315f614c0420304c7d'
AND (
token = 'k1tuRcpaJ1EYKkDR0UEVlLw8rnuDj8ckiACOunvjJ9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)