UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4fMmGJ4B79fuby8kE8ck9dsfeMXyV0mgAvmHCbnsesY='
WHERE
key_id = '715b3c17ef4cce22dd2e8a580182c7292e1fafdf395cc79f3dd9e6a7d6c4e66c'
AND (
token = '4fMmGJ4B79fuby8kE8ck9dsfeMXyV0mgAvmHCbnsesY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)