UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6A3gzcpCTEK7qfcb+6g+yl1yMa09wd6k8TnXEUJe5Ek='
WHERE
key_id = '67af0cc2c4c961b043d8c9d7ddb4441432d6deeadd2e69dc26bdb7a195920eee'
AND (
token = '6A3gzcpCTEK7qfcb+6g+yl1yMa09wd6k8TnXEUJe5Ek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)