UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvucAOx1J+SRYl7IjOYNtEaQjVEVbeL5vA/EIkQdGqw='
WHERE
key_id = 'c30848890a378a7017f4867eaaa8578b69090f156daf3eadbe1761b8fe5a8f0a'
AND (
token = 'cvucAOx1J+SRYl7IjOYNtEaQjVEVbeL5vA/EIkQdGqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)