UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGMrv53OBybmlWGJzlJszpiRutWtXoyFZYJrWtAqgp0='
WHERE
key_id = 'abb8600a25cbe8ebc2169636693293d96ae7de337816acad1789b5f1f48bfd6f'
AND (
token = 'QGMrv53OBybmlWGJzlJszpiRutWtXoyFZYJrWtAqgp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)